package lxs.tool.liberator.common.base.aspect;


import lxs.tool.liberator.common.base.result.Response;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;


@Aspect
@Component()
public class Aop {
//    @Around("execution(public lxs.tool.liberator.common.base.result.Response *.*(..))")
    public Response around(ProceedingJoinPoint joinPoint) throws Throwable {
        Response re;
        try {
            re = (Response) joinPoint.proceed();
        } catch (Exception e) {
            re = Response.error(e.getMessage());
        }
        return re;
    }
}
